package com.qm.vo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.awt.*;
import java.io.Serializable;

/**
 @author james
 @create 2021-03-23 16:35
 */
@Data
@Accessors(chain = true)
@NoArgsConstructor
@AllArgsConstructor
public class ImageVO implements Serializable {

    private Integer error;  //0 正常  1错误
    private String url;     //图片虚拟路径
    private Integer width;  //宽度
    private Integer height; //高度

    public static ImageVO fail() {
        return new ImageVO(1,null,null,null);
    }

    public static ImageVO success(String url,Integer width,Integer height) {
        return new ImageVO(0,url,width,height);
    }

}
